home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 076-100 / disk_098 / hddriver / driver / harddisk.h < prev    next >
C/C++ Source or Header  |  1992-05-06  |  2KB  |  88 lines

  1.  
  2. /*
  3.  *   Hard disk header file
  4.  */
  5.  
  6. /*
  7.  * Copyright 1987 Alan Kent
  8.  *
  9.  * Permission is granted to redistribute this code as long
  10.  * as this message is retained in the code and the code is
  11.  * not sold without written permission from the author.
  12.  *
  13.  * UUCP: {seismo,hplabs,mcvax,ukc,nttlab}!munnari!goanna.oz!ajk
  14.  * ACSnet: ajk@goanna.oz
  15.  * ARPA: munnari!goanna.oz!ajk@SEISMO.ARPA
  16.  */
  17.  
  18. #ifndef DEVICES_HARDDISK_H
  19. #define DEVICES_HARDDISK_H
  20.  
  21. #ifndef DEVICES_TRACKDISK_H
  22. #include "devices/trackdisk.h"
  23. #endif
  24.  
  25.  
  26. #define HD_NAME             "harddisk.device"
  27.  
  28.  
  29. /* at present, can only handle 1 unit */
  30. /* problems with sharing interrupts, caches etc */
  31.  
  32. #define HD_NUMUNITS    1
  33.  
  34. #define HD_SECTOR    512
  35. #define HD_SECSHIFT    9
  36.  
  37.  
  38. #define HD_PARK        (TD_LASTCOMM+1)
  39. #define HD_GETINFO    (TD_LASTCOMM+2)
  40. #define HD_LASTCOMM    HD_GETINFO
  41.  
  42.  
  43.  
  44. #define HD_MAGIC            0xCE11DCF0
  45.  
  46. #define HD_MAP_SIZE            (4*(HD_SECTOR/sizeof(LONG)))
  47. #define HD_MAP_SECTORS        (sizeof(struct hd_FirstSector)/HD_SECTOR)
  48.  
  49.  
  50.  
  51. struct hd_FirstSector {
  52.     LONG magic;
  53.     LONG cylinders;
  54.     LONG park_cylinder;
  55.     LONG heads;
  56.     LONG sectors;
  57.     LONG map_sectors;
  58.     LONG bad_sectors;
  59.     LONG precomp;
  60.     UBYTE pad[HD_SECTOR-8*sizeof(LONG)];
  61.  
  62.     UBYTE interleave[ HD_SECTOR ];
  63.  
  64.     LONG map[ HD_MAP_SIZE ];
  65. };
  66.  
  67.  
  68.  
  69. /* for map */
  70.  
  71. #define MAP_MARK_FREE    -1
  72.  
  73. /* MARK_BAD means the sector is a bad sector so dont use it */
  74.  
  75. #define MAP_MARK_BAD    -2
  76.  
  77.  
  78.  
  79. struct IOExtHD {
  80.     struct IOExtTD    iohd_TD;
  81.  
  82.     /* any extensions go here */
  83.  
  84.     struct hd_FirstSector iohd_Info;    /* used only by HD_GETINFO */
  85. };
  86.  
  87. #endif
  88.